<!DOCTYPE html>
<html>

<head lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0" />
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no" name="format-detection">
    <title>传智云购</title>
    <link type="image/x-icon" rel="shortcut icon" href="images/favicon.ico">
    <link rel="stylesheet" href="res/mui/css/mui.min.css" />
    <link rel="stylesheet" href="res/fontAwesome/css/font-awesome.min.css" />
    <link rel="stylesheet" href="css/common.css" />
    <link rel="stylesheet" href="css/index.css" />
    <style>
        * { touch-action: none; }
    </style>
</head>

<body>
    <div class="cz_layout">
        <header class="cz_topBar">
            <span>传智云购</span>
            <a class="icon_search fa fa-search" href="search.html"></a>
        </header>
        <div class="cz_container mui-scroll-wrapper">
            <div class="mui-scroll">
                <div class="cz_banner mui-slider">
                    <div class="mui-slider-group mui-slider-loop">
                        <div class="mui-slider-item mui-slider-item-duplicate">
                            <a href="#"><img src="images/banner6.png"></a>
                        </div>
                        <div class="mui-slider-item mui-active">
                            <a href="#"><img src="images/banner1.png"></a>
                        </div>
                        <div class="mui-slider-item">
                            <a href="#"><img src="images/banner2.png"></a>
                        </div>
                        <div class="mui-slider-item">
                            <a href="#"><img src="images/banner3.png"></a>
                        </div>
                        <div class="mui-slider-item">
                            <a href="#"><img src="images/banner4.png"></a>
                        </div>
                        <div class="mui-slider-item">
                            <a href="#"><img src="images/banner5.png"></a>
                        </div>
                        <div class="mui-slider-item">
                            <a href="#"><img src="images/banner6.png"></a>
                        </div>
                        <div class="mui-slider-item mui-slider-item-duplicate">
                            <a href="#"><img src="images/banner1.png"></a>
                        </div>
                    </div>
                    <div class="mui-slider-indicator">
                        <div class="mui-indicator mui-active"></div>
                        <div class="mui-indicator"></div>
                        <div class="mui-indicator"></div>
                        <div class="mui-indicator"></div>
                        <div class="mui-indicator"></div>
                        <div class="mui-indicator"></div>
                    </div>
                </div>
                <div class="cz_search">
                    <form action="">
                        <input class="search_input" type="search" placeholder="搜索你喜欢的商品">
                    </form>
                    <a class="search_btn" href="searchList.html">搜索</a>
                </div>
                <div class="cz_cate mui-clearfix">
                    <a href="#"><img src="images/nav1.png" alt="" /></a>
                    <a href="#"><img src="images/nav2.png" alt="" /></a>
                    <a href="#"><img src="images/nav3.png" alt="" /></a>
                    <a href="#"><img src="images/nav4.png" alt="" /></a>
                    <a href="#"><img src="images/nav5.png" alt="" /></a>
                    <a href="#"><img src="images/nav6.png" alt="" /></a>
                </div>
                <div class="cz_active">
                    <a href="#">
                        <img src="images/active1.png" alt="" />
                        <img src="images/active2.png" alt="" />
                    </a>
                    <a href="#">
                        <img src="images/active3.png" alt="" />
                    </a>
                    <a href="#">
                        <img src="images/active4.png" alt="" />
                        <img src="images/active5.png" alt="" />
                    </a>
                </div>
                <div class="cz_brand">
                    <img src="images/title0.png" alt="" />
                    <ul>
                        <li><a href="#"><img src="images/brand1.png" alt="" /></a></li>
                        <li><a href="#"><img src="images/brand2.png" alt="" /></a></li>
                        <li><a href="#"><img src="images/brand3.png" alt="" /></a></li>
                        <li><a href="#"><img src="images/brand4.png" alt="" /></a></li>
                        <li><a href="#"><img src="images/brand5.png" alt="" /></a></li>
                        <li><a href="#"><img src="images/brand6.png" alt="" /></a></li>
                        <li><a href="#"><img src="images/brand7.png" alt="" /></a></li>
                        <li><a href="#"><img src="images/brand8.png" alt="" /></a></li>
                    </ul>
                </div>
                <div class="cz_live">
                    <img src="images/title1.png" alt="" />
                    <div class="mui-clearfix" id="products">
                        <!-- <a href="#" class="cz_product">
                            <div class="box">
                                <img src="images/product.jpg" alt="" />
                                <p class="name">adidas阿迪达斯 男式 场下休闲篮球鞋S83700 </p>
                                <p><span class="price">&yen;560.00</span><span class="oldPrice">&yen;888.00</span></p>
                                <button class="button">立即购买</button>
                            </div>
                        </a> -->
                    </div>
                </div>
                <!-- <div class="cz_live">
                    <img src="images/title2.png" alt="" />
                    <div class="mui-clearfix">
                        <a href="#" class="cz_product">
                            <div class="box">
                                <img src="images/product.jpg" alt="" />
                                <p class="name">adidas阿迪达斯 男式 场下休闲篮球鞋S83700 </p>
                                <p><span class="price">&yen;560.00</span><span class="oldPrice">&yen;888.00</span></p>
                                <button class="button">立即购买</button>
                            </div>
                        </a>
                        <a href="#" class="cz_product">
                            <div class="box">
                                <img src="images/product.jpg" alt="" />
                                <p class="name">adidas阿迪达斯 男式 场下休闲篮球鞋S83700 </p>
                                <p><span class="price">&yen;560.00</span><span class="oldPrice">&yen;888.00</span></p>
                                <button class="button">立即购买</button>
                            </div>
                        </a>
                        <a href="#" class="cz_product">
                            <div class="box">
                                <img src="images/product.jpg" alt="" />
                                <p class="name">adidas阿迪达斯 男式 场下休闲篮球鞋S83700 </p>
                                <p><span class="price">&yen;560.00</span><span class="oldPrice">&yen;888.00</span></p>
                                <button class="button">立即购买</button>
                            </div>
                        </a>
                        <a href="#" class="cz_product">
                            <div class="box">
                                <img src="images/product.jpg" alt="" />
                                <p class="name">adidas阿迪达斯 男式 场下休闲篮球鞋S83700 </p>
                                <p><span class="price">&yen;560.00</span><span class="oldPrice">&yen;888.00</span></p>
                                <button class="button">立即购买</button>
                            </div>
                        </a>
                    </div>
                </div>
                <div class="cz_live">
                    <img src="images/title3.png" alt="" />
                    <div class="mui-clearfix">
                        <a href="#" class="cz_product">
                            <div class="box">
                                <img src="images/product.jpg" alt="" />
                                <p class="name">adidas阿迪达斯 男式 场下休闲篮球鞋S83700 </p>
                                <p><span class="price">&yen;560.00</span><span class="oldPrice">&yen;888.00</span></p>
                                <button class="button">立即购买</button>
                            </div>
                        </a>
                        <a href="#" class="cz_product">
                            <div class="box">
                                <img src="images/product.jpg" alt="" />
                                <p class="name">adidas阿迪达斯 男式 场下休闲篮球鞋S83700 </p>
                                <p><span class="price">&yen;560.00</span><span class="oldPrice">&yen;888.00</span></p>
                                <button class="button">立即购买</button>
                            </div>
                        </a>
                        <a href="#" class="cz_product">
                            <div class="box">
                                <img src="images/product.jpg" alt="" />
                                <p class="name">adidas阿迪达斯 男式 场下休闲篮球鞋S83700 </p>
                                <p><span class="price">&yen;560.00</span><span class="oldPrice">&yen;888.00</span></p>
                                <button class="button">立即购买</button>
                            </div>
                        </a>
                        <a href="#" class="cz_product">
                            <div class="box">
                                <img src="images/product.jpg" alt="" />
                                <p class="name">adidas阿迪达斯 男式 场下休闲篮球鞋S83700 </p>
                                <p><span class="price">&yen;560.00</span><span class="oldPrice">&yen;888.00</span></p>
                                <button class="button">立即购买</button>
                            </div>
                        </a>
                    </div>
                </div> -->
            </div>
        </div>
        <footer class="cz_tabs">
            <a class="tab_home fa fa-home now" href="index.html"><span>首页</span></a>
            <a class="tab_cate fa fa-bars" href="cate.html"><span>分类</span></a>
            <a class="tab_cart fa fa-shopping-cart" href="cart.html"><span>购物车</span></a>
            <a class="tab_user fa fa-user" href="user/index.html"><span>会员中心</span></a>
        </footer>
    </div>
    <script src="res/mui/js/mui.min.js"></script>
    <script src="/assets/vendors/jquery/jquery.min.js"></script>
    <script src="/assets/vendors/template-web.js"></script>
    <script type="text/template" id="tpl">
        {{each data value}}
            <a href="/product.html?id={{value.id}}" class="cz_product">
                <div class="box">
                    <img src="/api{{value.pic[0].picAddr}}" alt="" />
                    <p class="name">{{value.proName}} </p>
                    <p><span class="price">&yen;{{value.price}}</span><span class="oldPrice">&yen;{{value.oldPrice}}</span></p>
                    <button class="button">立即购买</button>
                </div>
            </a>
        {{/each}}
    </script>
    <script>
        mui(function () {
            mui('.mui-slider').slider({
                interval: 3000 //自动轮播周期，若为0则不自动播放，默认为0；
            });
            mui('.mui-scroll-wrapper').scroll({
                scrollY: true, //是否竖向滚动
                scrollX: false, //是否横向滚动
                startX: 0, //初始化时滚动至x
                startY: 0, //初始化时滚动至y
                indicators: false, //是否显示滚动条
                deceleration: 0.0006, //阻尼系数,系数越小滑动越灵敏
                bounce: true, //是否启用回弹
            });
        });
        $.ajax({
            url: '/api/product/queryProduct',
            data: {
                page: '1',
                pageSize: '6'
            },
            success: function (msg) {
                var srtHtml = template('tpl', msg);
                $('#products').html(srtHtml);
            }
        });
    </script>

</body>

</html>